﻿using System.Drawing;
using Microsoft.VisualBasic.PowerPacks;
using G.Runtime;

namespace GameDesigner.Source.Widgets
{
    class LabelWidget : Widget
    {
        private readonly SimpleShape _Shape;
        
        private string _DisplayableName;
        private Point _Point = new Point(10, 10);

        public LabelWidget(SimpleShape control, string name)
        {
            _Shape = control;
            _DisplayableName = name;
        }
        
        public void Dispose() 
        {
        }

        public Point Point
        {
            get { return _Point; }
            set { _Point = value; }
        }

        public void Update(Graphics graphics) 
        {
            Font fn = new Font("Comic Sans MS", 12);
            SolidBrush solidBlack = new SolidBrush(Color.Black);
            Point point = new Point(_Shape.Location.X + _Point.X, _Shape.Location.Y + _Point.Y); 
            graphics.DrawString(_DisplayableName, fn, solidBlack, point);
        }

    }
}
